source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "libssh2-sys 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libssh2-sys 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "libssh2-sys"
-version = "0.1.19"
+version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
/// Create a new HTTP handle with appropriate global configuration for cargo.
pub fn http_handle(config: &Config) -> CargoResult<http::Handle> {
- let handle = http::handle().timeout(60_000);
+ // The timeout option for libcurl by default times out the entire transfer,
+ // but we probably don't want this. Instead we only set timeouts for the
+ // connect phase as well as a "low speed" timeout so if we don't receive
+ // many bytes in a large-ish period of time then we time out.
+ let handle = http::handle().timeout(0)
+ .connect_timeout(30_000 /* milliseconds */)
+ .low_speed_limit(10 /* bytes per second */)
+ .low_speed_timeout(30 /* seconds */);
let handle = match try!(http_proxy(config)) {
Some(proxy) => handle.proxy(proxy),
None => handle,
};
let handle = match try!(http_timeout(config)) {
- Some(timeout) => handle.timeout(timeout as usize),
+ Some(timeout) => handle.connect_timeout(timeout as usize)
+ .low_speed_timeout((timeout as usize) / 1000),
None => handle,
};
Ok(handle)